package day_01;

import java.io.*;

public class File_charStream {
    private static StringBuffer sb = null;
    public static void main(String[] args) throws IOException {
        File file = new File(".\\Test\\2.txt");
        printString(file);
    }

    public static void printString(File file) throws IOException {

        Reader fr = new FileReader(file);
        char[] chars = new char[1024];
        int len = -1;
        sb = new StringBuffer();
        while((len = fr.read(chars))!=-1){
            sb.append(chars,0,len);
        }

        System.out.println(sb);
        fr.close();

    }


}
